package com.exchange.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.exchange.entity.pojo.Wallet;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;

/**
* @author Administrator
* @description 针对表【wallet】的数据库操作Mapper
* @createDate 2024-04-25 20:02:10
* @Entity com.exchange.entity.pojo.Wallet
*/
public interface WalletMapper extends BaseMapper<Wallet> {
    @Select("select * from wallet where uid = #{id}")
    Wallet buyPackage(Long id);



    @Update("update wallet set money = 0 where uid = #{id}")
    void updates(Long id);

    @Select("select id from wallet where uid = #{uid}")
    Long selectByUid(Long uid);

    @Insert("insert into wallet(uid,money) values(#{id},#{walletMoney})")
    void inserts(@Param("id") Long id,@Param("walletMoney") BigDecimal walletMoney);


    Integer findWallets(Long id);
}




